# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-plugnplay
pkgname=('python2-plugnplay' 'python-plugnplay')
_pkgname=plugnplay
pkgver=0.5.4
pkgrel=6
pkgdesc='A Generic plug-in system for python.'
arch=('any')
url='https://pypi.org/project/plugnplay/#files'
license=('GPL2')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('4fff9116676e8587b115790889ba8adf09a0a389a2394a1d8998b8a06a74f68dd75ccbb1c433a53b071d281603b3276d457fd1c432675a9590db96968384397e')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-plugnplay() {
  depends=('python2')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

package_python-plugnplay() {
  depends=('python')

  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

